//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package messages;

import common.ByteStream;

public class BuyFromStandResponse extends Base {
  public static final int MsgType = 24103;
  public long buyerId;
  public long sellerId;
  public int slot;
  public int productId;
  public int amount;
  public int price;
  public int responseStatus;
  public int gemsPrice;

  public BuyFromStandResponse() {
    super(24103);
  }

  public void encode(ByteStream stream) {
  }

  public void decode(ByteStream stream) {
    this.responseStatus = stream.readInt();
    if(this.responseStatus == 0) {
      boolean a = stream.readBoolean();
      if(a) {
        this.buyerId = stream.readLong().longValue();
      }

      boolean sellerPresent = stream.readBoolean();
      if(sellerPresent) {
        this.sellerId = stream.readLong().longValue();
      }
    } else {
      byte a1 = stream.readByte();
      if(a1 != 0) {
        this.sellerId = stream.readLong().longValue();
      }
    }

    this.productId = stream.readInt();
    this.amount = stream.readInt();
    this.price = stream.readInt();
    this.slot = stream.readInt();
    this.gemsPrice = stream.readInt();
    this.isDecoded = true;
  }

  public String toString() {
    return this.responseStatus == 3?"Status:" + this.responseStatus + ", allready sold":"Status:" + this.responseStatus + ", ProductId:" + this.productId + ", Amount:" + this.amount + ", Price:" + this.price;
  }
}
